package com.itheima.health.dao;

import com.itheima.health.pojo.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 会员DAO
 */
@Mapper
@Repository
public interface MemberDao {

    //通过身份证查询 会员信息
    List<Member> selectByPhone(String idCard);

    // 注册会员
    void save(Member regMember);

    Member selectOneUser(@Param("phone")String phone);

    //手机端登录功能
    void insertUser(@Param("phone") String phone);

    //查询某个日期之前的会员人数
    Integer findMemberCountBeforeDate(String date);

    Integer findTotalMember();

    Integer findTodayNewMember(@Param("today") String today);

    Integer findThisWeekNewMember(@Param("weekMember") String weekTimesStart);

    Integer findThisMonthNewMember(@Param("monthMember") String monthTimesStart);
}
